import matplotlib.pyplot as plt

#plt.scatter(2,4,s=200)

#plt.scatter([1,2,3,4,5],[1,4,9,16,25],s=100)

x_values = list( range(1,1001))
y_values = [x**2 for x in x_values]
#plt.scatter(x_values, y_values, c="red", edgecolor="none", s=40)

#颜色映射
plt.scatter(x_values, y_values, c=y_values, cmap=plt.cm.Blues, edgecolor="none", s=40)

#设置图表标题并给坐标轴加上标签
plt.title("Square Numbers", fontsize=24)
plt.xlabel("Value", fontsize=14)
plt.ylabel("Squares of Value",fontsize=14)

#设置刻度标记的大小
plt.tick_params(axis="both", which="major", labelsize=14)

plt.show()

#自动保存图表
plt.savefig("squares_plot.png", bbox_inches="tight")
